package com.open.capacity.trade.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.open.capacity.common.model.Remittance;
import com.open.capacity.trade.vo.RemittanceVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface RemittanceDao extends BaseMapper<Remittance> {
    int count(Map<String, Object> params);

    List<RemittanceVo> findAllRemittance(Map<String, Object> params);

    @Select("select * from crm_remittance where crm_remittance.id=#{id} and crm_remittance.remittance_id=#{remittanceId}")
    Remittance findById(@Param("id") Long id, @Param("remittanceId") Long remittanceId);

    @Delete("delete from crm_remittance where crm_remittance.id = #{id} and crm_remittance.remittance_id=#{remittanceId}")
    void deleteRemittance(@Param("id") Long id,@Param("remittanceId") Long remittanceId);

    int updateOrEnabled(Remittance remittance);

    int insertRemittance(Remittance remittance);

    Integer updateRemittance(Remittance remittance);
}
